package java6699.lesson01;
import java.util.Objects;
public class Product6699 {
    private String name;
    public Product6699() {
    }
    public Product6699(String name){
        this.name=name;
    }
    //重写toString方法，更改输出的结果
    @Override
    public String toString() {
        return name;
    }
    //重写equals方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Product6699)) return false;
        Product6699 that = (Product6699) o;
        return Objects.equals(name, that.name);
    }
    @Override
    public int hashCode() {
        return Objects.hash(name);
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}
